Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:(allstate): Add allstate users to withdraw package state users #1088

Merged
merged 26 commits into from
Jan 30, 2025

Conversation

benjaminpaige
Copy link
Collaborator

@benjaminpaige benjaminpaige commented Jan 29, 2025

Emails were sent concurrently with potential race conditions, and all state users were not included in withdrawal notifications.
Emails are now sent sequentially with improved logging and error handling. All state users receive withdrawal notifications.

🔧 Changes

  • Removed p-limit to send emails sequentially instead of concurrently.
  • Introduced improved logging for email sending success/failure tracking.
  • Ensured that withdrawEmailSent is checked before sending duplicate withdrawal emails.
  • Updated OpenSearch records to track withdrawEmailSent status.
  • Fixed email recipient logic to include all state users in withdrawal notifications.
  • Improved validation of user email attributes from Cognito.
  • Added logging for missing or invalid email addresses.
  • Applied consistent email formatting for improved readability.

🚀 How to Test

  1. Trigger an event that sends emails and verify that emails are processed sequentially.
  2. Ensure that withdrawal emails are not sent twice for the same record.
  3. Confirm that OpenSearch records are updated correctly with withdrawEmailSent: true.
  4. Check logs for detailed email success/failure counts.
  5. Validate that all intended recipients, including all state users, receive withdrawal emails.
  6. Test with users having missing or malformed email attributes and verify logging behavior.

@benjaminpaige benjaminpaige changed the title Update Add allstate users Jan 29, 2025
Copy link
Contributor

github-actions bot commented Jan 29, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 87.7% 4187 / 4774
🔵 Statements 87.13% 4558 / 5231
🔵 Functions 79.05% 1223 / 1547
🔵 Branches 72.22% 2059 / 2851
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
lib/lambda/processEmails.ts 79.69% 61.11% 100% 78.57% 117, 123, 133-182, 186-187, 235-238, 256-257
lib/libs/email/getAllStateUsers.ts 75.86% 66.66% 100% 75% 43, 61-62, 68-69, 84-85
lib/libs/email/content/email-components.tsx 88.4% 93.18% 90.9% 89.23% 32, 39-51, 130-135, 288-296, 323-324, 354-355
lib/libs/email/content/withdrawPackage/index.tsx 77.77% 25% 75% 77.77% 88-107
lib/packages/shared-types/opensearch/main/index.ts 100% 100% 100% 100%
Generated in workflow #1832 for commit a05f854 by the Vitest Coverage Report Action

@benjaminpaige benjaminpaige changed the title Add allstate users feat:(allstate): Add allstate users to withdraw package state users Jan 29, 2025
@jdinh8124 jdinh8124 merged commit b6c09a7 into main Jan 30, 2025
6 checks passed
@jdinh8124 jdinh8124 deleted the allstate branch January 30, 2025 15:43
Copy link
Contributor

🎉 This PR is included in version 1.5.0-val.120 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants